angular.module('meMyLevelServices', [])

  .factory('MeMyLevel', function ($resource, $rootScope, ENV, Storage) {

    //设置访问接口路径
    var APIUrl = ENV.api;

    //访问获取用户信息的接口
    var meMoreGradeIntroResource = $resource(APIUrl + "meMore/toGradeIntro.do");

    var myLevelPageInfoJson;

    return{

      //获取我的等级界面的相关信息
      getMyLevelPageInfo : function (member_id) {
        meMoreGradeIntroResource.save(
          {member_id : member_id},
          function(data){
            console.log(data);
            myLevelPageInfoJson = data;
            //广播一下
            $rootScope.$broadcast('Me.myLevelInfoGot');
          }
        );
      },

      getMyLevelPageInfoJson : function(){
        return myLevelPageInfoJson;
      }




    }


});
